<template>
    <rx-dialog @handOk="handleSubmit" @cancel="cancel">
        <rx-layout>
            <div slot="center">
                <a-form-model ref="form" :model="mdl" :rules="rules">
                    <a-form-model-item style="display: none">
                        <a-input v-model="mdl.id"/>
                    </a-form-model-item>
                      <a-row>
                      <a-col :span="24">
                          <a-form-model-item :labelCol="labelCol1" :wrapperCol="wrapperCol1" :label="i18n('form.userId','用户ID')" prop="userId">
                            <a-input :placeholder="i18n('form.userId','用户ID')" v-model="mdl.userId"/>
                          </a-form-model-item>
                      </a-col>
                  </a-row>
                      <a-row>
                      <a-col :span="24">
                          <a-form-model-item :labelCol="labelCol1" :wrapperCol="wrapperCol1" :label="i18n('form.isAdmin','是否超管')" prop="isAdmin">
                            <a-input-number :min="0" :max="1000000" :placeholder="i18n('form.isAdmin','是否超管')" v-model="mdl.isAdmin"/>
                          </a-form-model-item>
                      </a-col>
                  </a-row>
                </a-form-model>
            </div>
        </rx-layout>
    </rx-dialog>
</template>
<script>
  import OsInstUsersApi from '@/api/user/org/osInstUsers'
  import {BaseFormModel,RxDialog} from "@lowcode/jpaas-common-lib";
  export default {
    name: 'OsInstUsersEdit',
    mixins:[BaseFormModel],
    components: {
      RxDialog,
    },
    data(){
      return {
        rules: {
          userId: [{ required:false,message:this.i18n('form.userId','用户ID','input'), trigger: 'change' }],
          isAdmin: [{ required:false,message:this.i18n('form.isAdmin','是否超管','input'), trigger: 'change' }],
        }
      }
    },
    methods: {
      i18n(name,text,key){
          return this.$ti18(name,text,"OsInstUsers",key);
      },
      get(id){
        return OsInstUsersApi.get(id);
      },
      save(values){
        return OsInstUsersApi.save(values);
      }

    }
  }
</script>
